<%=error_messages_for 'leave'%>
<% title "Attendance Information" %>
<%= render :partial => 'breadcrumbs' %>
<table class="form">
	<tr>
		<th colspan="3">Personal Information</th>
	</tr>
	<tr>
		<td width="3%">1.</td>
		<td width="13%"><strong>Name :</strong></td>
		<td><%=@employee.name%></td>
	</tr>
	<tr>
		<td>2.</td>
		<td><strong>Employee No :</strong></td>
		<td><%=@employee.employee_number%></td>
	</tr>
	<tr>
		<td>3.</td>
		<td><strong>Department : </strong></td>
		<td><%=@employee.department.title unless @employee.department.nil?%></td>
	</tr>
	<tr>
		<td>4.</td>
		<td><strong>Position : </strong></td>
		<td><%=@employee.position.title unless @employee.position.nil?%></td>
	</tr>
	<tr>
		<td>5.</td>
		<td><strong>Gred : </strong></td>
		<td><%=@employee.position.gred.title unless @employee.position.gred.nil?%></td>
	</tr>
</table>
<% form_for :leave, @leave, 
:url => { :controller => 'myoffice', :action => "create_leave", :id => @leave } do  %>
<table class="form">
		<tr>
			<th colspan="3">Leave Application Details</th>
		</tr>
		<tr>
			<td width="3%">1.</td>
			<td width="13%"><strong>Leave Portion</strong></td>
			<td><%@leave_portions.each do |leave_portion|%>
  <%=leave_portion.title%> <%if leave_portion.id == 1%><%=radio_button("leave", "leave_portion_id", leave_portion.id, :checked => true)%><%else%>
    <%=radio_button("leave", "leave_portion_id", leave_portion.id)%><%end%><br />
  <%end%></td>
		</tr>
		<tr>
			<td>2.</td>
			<td><strong>Leave Type :</strong></td>
			<td><%=collection_select(:leave, :leave_type_id, @leave_types,:id,:title,{:prompt => true})%></td>
		</tr>
		<tr>
			<td>3.</td>
			<td><strong>On / From :</strong></td>
			<td><%= date_select("leave", "start_date", :order => [:day, :month, :year],:start_year => Time.now.year, :end_year => Time.now.year)%></td>
		</tr>
		<tr>
			<td>4.</td>
			<td><strong>To : </strong></td>
			<td><%= date_select("leave", "end_date", :order => [:day, :month, :year],:start_year => Time.now.year, :end_year => Time.now.year+1)%></td>
		</tr>
		<tr>
			<td>5.</td>
			<td><strong> Remarks : </strong></td>
			<td><%=text_area :leave, :remarks,:rows => 20, :cols => 40%></td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
			<td><%=submit_tag 'Submit' %></td>
		</tr>
	</table>
<% end %>
